<?php

declare(strict_types=1);

namespace Core\Package\ElementPlus\FormCreate\FormItem;

/**
 * 开关
 * Class Color
 */
class MdEditor extends FormItemAbstract
{
    protected string $_type = 'md-editor';

    /**
     * 获取值类型
     * @return string
     */
    public function valueType(): string
    {
        return self::VALUE_TYPE_STRING;
    }


    public function defaultProps(): array
    {
        return [
            'height' => 500,
            'placeholder' => '',
        ];
    }

    /**
     * Radio constructor.
     * @param string $field
     * @param string $title
     * @param string $value
     */
    public function __construct(string $field, string $title, string $value = '')
    {
        $this->_title = $title;
        $this->_field = $field;
        $this->_value = $value;
        $this->clearable(false);
    }


    /**
     * @param int $height
     * @return Editor
     */
    public function height(int $height): MdEditor
    {
        return $this->props('height', $height);
    }


    /**
     * @param string $placeholder
     * @return Editor
     */
    public function placeholder(string $placeholder): MdEditor
    {
        return $this->props('placeholder', $placeholder);
    }

}